Optimal. Leaf size=114 \[ -\frac {a (b c-a d)^2 (a+b x)^{1+n}}{b^4 (1+n)}+\frac {(b c-3 a d) (b c-a d) (a+b x)^{2+n}}{b^4 (2+n)}+\frac {d (2 b c-3 a d) (a+b x)^{3+n}}{b^4 (3+n)}+\frac {d^2 (a+b x)^{4+n}}{b^4 (4+n)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 1, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.062, Rules used = {78}
\begin {gather*} -\frac {a (b c-a d)^2 (a+b x)^{n+1}}{b^4 (n+1)}+\frac {(b c-3 a d) (b c-a d) (a+b x)^{n+2}}{b^4 (n+2)}+\frac {d (2 b c-3 a d) (a+b x)^{n+3}}{b^4 (n+3)}+\frac {d^2 (a+b x)^{n+4}}{b^4 (n+4)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rubi steps
\begin {align*} \int x (a+b x)^n (c+d x)^2 \, dx &=\int \left (-\frac {a (-b c+a d)^2 (a+b x)^n}{b^3}+\frac {(b c-3 a d) (b c-a d) (a+b x)^{1+n}}{b^3}+\frac {d (2 b c-3 a d) (a+b x)^{2+n}}{b^3}+\frac {d^2 (a+b x)^{3+n}}{b^3}\right ) \, dx\\ &=-\frac {a (b c-a d)^2 (a+b x)^{1+n}}{b^4 (1+n)}+\frac {(b c-3 a d) (b c-a d) (a+b x)^{2+n}}{b^4 (2+n)}+\frac {d (2 b c-3 a d) (a+b x)^{3+n}}{b^4 (3+n)}+\frac {d^2 (a+b x)^{4+n}}{b^4 (4+n)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.09, size = 98, normalized size = 0.86 \begin {gather*} \frac {(a+b x)^{1+n} \left (-\frac {a (b c-a d)^2}{1+n}+\frac {(b c-3 a d) (b c-a d) (a+b x)}{2+n}+\frac {d (2 b c-3 a d) (a+b x)^2}{3+n}+\frac {d^2 (a+b x)^3}{4+n}\right )}{b^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(320\) vs.
\(2(114)=228\).
time = 0.09, size = 321, normalized size = 2.82
method | result | size |
norman | \(\frac {d^{2} x^{4} {\mathrm e}^{n \ln \left (b x +a \right )}}{4+n}+\frac {d \left (a d n +2 b c n +8 b c \right ) x^{3} {\mathrm e}^{n \ln \left (b x +a \right )}}{b \left (n^{2}+7 n +12\right )}+\frac {n a \left (b^{2} c^{2} n^{2}-4 a b c d n +7 b^{2} c^{2} n +6 a^{2} d^{2}-16 a b c d +12 b^{2} c^{2}\right ) x \,{\mathrm e}^{n \ln \left (b x +a \right )}}{b^{3} \left (n^{4}+10 n^{3}+35 n^{2}+50 n +24\right )}-\frac {a^{2} \left (b^{2} c^{2} n^{2}-4 a b c d n +7 b^{2} c^{2} n +6 a^{2} d^{2}-16 a b c d +12 b^{2} c^{2}\right ) {\mathrm e}^{n \ln \left (b x +a \right )}}{b^{4} \left (n^{4}+10 n^{3}+35 n^{2}+50 n +24\right )}-\frac {\left (-2 a b c d \,n^{2}-b^{2} c^{2} n^{2}+3 a^{2} d^{2} n -8 a b c d n -7 b^{2} c^{2} n -12 b^{2} c^{2}\right ) x^{2} {\mathrm e}^{n \ln \left (b x +a \right )}}{b^{2} \left (n^{3}+9 n^{2}+26 n +24\right )}\) | \(321\) |
gosper | \(-\frac {\left (b x +a \right )^{1+n} \left (-b^{3} d^{2} n^{3} x^{3}-2 b^{3} c d \,n^{3} x^{2}-6 b^{3} d^{2} n^{2} x^{3}+3 a \,b^{2} d^{2} n^{2} x^{2}-b^{3} c^{2} n^{3} x -14 b^{3} c d \,n^{2} x^{2}-11 b^{3} d^{2} n \,x^{3}+4 a \,b^{2} c d \,n^{2} x +9 a \,b^{2} d^{2} n \,x^{2}-8 b^{3} c^{2} n^{2} x -28 b^{3} c d n \,x^{2}-6 d^{2} x^{3} b^{3}-6 a^{2} b \,d^{2} n x +a \,b^{2} c^{2} n^{2}+20 a \,b^{2} c d n x +6 a \,b^{2} d^{2} x^{2}-19 b^{3} c^{2} n x -16 b^{3} c d \,x^{2}-4 a^{2} b c d n -6 a^{2} b \,d^{2} x +7 a \,b^{2} c^{2} n +16 a \,b^{2} c d x -12 b^{3} c^{2} x +6 a^{3} d^{2}-16 a^{2} b c d +12 a \,b^{2} c^{2}\right )}{b^{4} \left (n^{4}+10 n^{3}+35 n^{2}+50 n +24\right )}\) | \(324\) |
risch | \(-\frac {\left (-b^{4} d^{2} n^{3} x^{4}-a \,b^{3} d^{2} n^{3} x^{3}-2 b^{4} c d \,n^{3} x^{3}-6 b^{4} d^{2} n^{2} x^{4}-2 a \,b^{3} c d \,n^{3} x^{2}-3 a \,b^{3} d^{2} n^{2} x^{3}-b^{4} c^{2} n^{3} x^{2}-14 b^{4} c d \,n^{2} x^{3}-11 b^{4} d^{2} n \,x^{4}+3 a^{2} b^{2} d^{2} n^{2} x^{2}-a \,b^{3} c^{2} n^{3} x -10 a \,b^{3} c d \,n^{2} x^{2}-2 a \,b^{3} d^{2} n \,x^{3}-8 b^{4} c^{2} n^{2} x^{2}-28 b^{4} c d n \,x^{3}-6 d^{2} x^{4} b^{4}+4 a^{2} b^{2} c d \,n^{2} x +3 a^{2} b^{2} d^{2} n \,x^{2}-7 a \,b^{3} c^{2} n^{2} x -8 a \,b^{3} c d n \,x^{2}-19 b^{4} c^{2} n \,x^{2}-16 b^{4} c d \,x^{3}-6 a^{3} b \,d^{2} n x +a^{2} b^{2} c^{2} n^{2}+16 a^{2} b^{2} c d n x -12 a \,b^{3} c^{2} n x -12 b^{4} c^{2} x^{2}-4 a^{3} b c d n +7 a^{2} b^{2} c^{2} n +6 a^{4} d^{2}-16 a^{3} b c d +12 a^{2} b^{2} c^{2}\right ) \left (b x +a \right )^{n}}{\left (3+n \right ) \left (4+n \right ) \left (2+n \right ) \left (1+n \right ) b^{4}}\) | \(433\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.39, size = 221, normalized size = 1.94 \begin {gather*} \frac {{\left (b^{2} {\left (n + 1\right )} x^{2} + a b n x - a^{2}\right )} {\left (b x + a\right )}^{n} c^{2}}{{\left (n^{2} + 3 \, n + 2\right )} b^{2}} + \frac {2 \, {\left ({\left (n^{2} + 3 \, n + 2\right )} b^{3} x^{3} + {\left (n^{2} + n\right )} a b^{2} x^{2} - 2 \, a^{2} b n x + 2 \, a^{3}\right )} {\left (b x + a\right )}^{n} c d}{{\left (n^{3} + 6 \, n^{2} + 11 \, n + 6\right )} b^{3}} + \frac {{\left ({\left (n^{3} + 6 \, n^{2} + 11 \, n + 6\right )} b^{4} x^{4} + {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} a b^{3} x^{3} - 3 \, {\left (n^{2} + n\right )} a^{2} b^{2} x^{2} + 6 \, a^{3} b n x - 6 \, a^{4}\right )} {\left (b x + a\right )}^{n} d^{2}}{{\left (n^{4} + 10 \, n^{3} + 35 \, n^{2} + 50 \, n + 24\right )} b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 393 vs.
\(2 (114) = 228\).
time = 0.48, size = 393, normalized size = 3.45 \begin {gather*} -\frac {{\left (a^{2} b^{2} c^{2} n^{2} + 12 \, a^{2} b^{2} c^{2} - 16 \, a^{3} b c d + 6 \, a^{4} d^{2} - {\left (b^{4} d^{2} n^{3} + 6 \, b^{4} d^{2} n^{2} + 11 \, b^{4} d^{2} n + 6 \, b^{4} d^{2}\right )} x^{4} - {\left (16 \, b^{4} c d + {\left (2 \, b^{4} c d + a b^{3} d^{2}\right )} n^{3} + {\left (14 \, b^{4} c d + 3 \, a b^{3} d^{2}\right )} n^{2} + 2 \, {\left (14 \, b^{4} c d + a b^{3} d^{2}\right )} n\right )} x^{3} - {\left (12 \, b^{4} c^{2} + {\left (b^{4} c^{2} + 2 \, a b^{3} c d\right )} n^{3} + {\left (8 \, b^{4} c^{2} + 10 \, a b^{3} c d - 3 \, a^{2} b^{2} d^{2}\right )} n^{2} + {\left (19 \, b^{4} c^{2} + 8 \, a b^{3} c d - 3 \, a^{2} b^{2} d^{2}\right )} n\right )} x^{2} + {\left (7 \, a^{2} b^{2} c^{2} - 4 \, a^{3} b c d\right )} n - {\left (a b^{3} c^{2} n^{3} + {\left (7 \, a b^{3} c^{2} - 4 \, a^{2} b^{2} c d\right )} n^{2} + 2 \, {\left (6 \, a b^{3} c^{2} - 8 \, a^{2} b^{2} c d + 3 \, a^{3} b d^{2}\right )} n\right )} x\right )} {\left (b x + a\right )}^{n}}{b^{4} n^{4} + 10 \, b^{4} n^{3} + 35 \, b^{4} n^{2} + 50 \, b^{4} n + 24 \, b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 3412 vs.
\(2 (100) = 200\).
time = 1.10, size = 3412, normalized size = 29.93 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 659 vs.
\(2 (114) = 228\).
time = 1.44, size = 659, normalized size = 5.78 \begin {gather*} \frac {{\left (b x + a\right )}^{n} b^{4} d^{2} n^{3} x^{4} + 2 \, {\left (b x + a\right )}^{n} b^{4} c d n^{3} x^{3} + {\left (b x + a\right )}^{n} a b^{3} d^{2} n^{3} x^{3} + 6 \, {\left (b x + a\right )}^{n} b^{4} d^{2} n^{2} x^{4} + {\left (b x + a\right )}^{n} b^{4} c^{2} n^{3} x^{2} + 2 \, {\left (b x + a\right )}^{n} a b^{3} c d n^{3} x^{2} + 14 \, {\left (b x + a\right )}^{n} b^{4} c d n^{2} x^{3} + 3 \, {\left (b x + a\right )}^{n} a b^{3} d^{2} n^{2} x^{3} + 11 \, {\left (b x + a\right )}^{n} b^{4} d^{2} n x^{4} + {\left (b x + a\right )}^{n} a b^{3} c^{2} n^{3} x + 8 \, {\left (b x + a\right )}^{n} b^{4} c^{2} n^{2} x^{2} + 10 \, {\left (b x + a\right )}^{n} a b^{3} c d n^{2} x^{2} - 3 \, {\left (b x + a\right )}^{n} a^{2} b^{2} d^{2} n^{2} x^{2} + 28 \, {\left (b x + a\right )}^{n} b^{4} c d n x^{3} + 2 \, {\left (b x + a\right )}^{n} a b^{3} d^{2} n x^{3} + 6 \, {\left (b x + a\right )}^{n} b^{4} d^{2} x^{4} + 7 \, {\left (b x + a\right )}^{n} a b^{3} c^{2} n^{2} x - 4 \, {\left (b x + a\right )}^{n} a^{2} b^{2} c d n^{2} x + 19 \, {\left (b x + a\right )}^{n} b^{4} c^{2} n x^{2} + 8 \, {\left (b x + a\right )}^{n} a b^{3} c d n x^{2} - 3 \, {\left (b x + a\right )}^{n} a^{2} b^{2} d^{2} n x^{2} + 16 \, {\left (b x + a\right )}^{n} b^{4} c d x^{3} - {\left (b x + a\right )}^{n} a^{2} b^{2} c^{2} n^{2} + 12 \, {\left (b x + a\right )}^{n} a b^{3} c^{2} n x - 16 \, {\left (b x + a\right )}^{n} a^{2} b^{2} c d n x + 6 \, {\left (b x + a\right )}^{n} a^{3} b d^{2} n x + 12 \, {\left (b x + a\right )}^{n} b^{4} c^{2} x^{2} - 7 \, {\left (b x + a\right )}^{n} a^{2} b^{2} c^{2} n + 4 \, {\left (b x + a\right )}^{n} a^{3} b c d n - 12 \, {\left (b x + a\right )}^{n} a^{2} b^{2} c^{2} + 16 \, {\left (b x + a\right )}^{n} a^{3} b c d - 6 \, {\left (b x + a\right )}^{n} a^{4} d^{2}}{b^{4} n^{4} + 10 \, b^{4} n^{3} + 35 \, b^{4} n^{2} + 50 \, b^{4} n + 24 \, b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.22, size = 335, normalized size = 2.94 \begin {gather*} {\left (a+b\,x\right )}^n\,\left (\frac {d^2\,x^4\,\left (n^3+6\,n^2+11\,n+6\right )}{n^4+10\,n^3+35\,n^2+50\,n+24}-\frac {a^2\,\left (6\,a^2\,d^2-4\,a\,b\,c\,d\,n-16\,a\,b\,c\,d+b^2\,c^2\,n^2+7\,b^2\,c^2\,n+12\,b^2\,c^2\right )}{b^4\,\left (n^4+10\,n^3+35\,n^2+50\,n+24\right )}+\frac {x^2\,\left (n+1\right )\,\left (-3\,a^2\,d^2\,n+2\,a\,b\,c\,d\,n^2+8\,a\,b\,c\,d\,n+b^2\,c^2\,n^2+7\,b^2\,c^2\,n+12\,b^2\,c^2\right )}{b^2\,\left (n^4+10\,n^3+35\,n^2+50\,n+24\right )}+\frac {a\,n\,x\,\left (6\,a^2\,d^2-4\,a\,b\,c\,d\,n-16\,a\,b\,c\,d+b^2\,c^2\,n^2+7\,b^2\,c^2\,n+12\,b^2\,c^2\right )}{b^3\,\left (n^4+10\,n^3+35\,n^2+50\,n+24\right )}+\frac {d\,x^3\,\left (8\,b\,c+a\,d\,n+2\,b\,c\,n\right )\,\left (n^2+3\,n+2\right )}{b\,\left (n^4+10\,n^3+35\,n^2+50\,n+24\right )}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________